/****

activequant - activestocks.eu

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


contact  : contact@activestocks.eu
homepage : http://www.activestocks.eu

****/
package org.activequant.core.domainmodel.options;

import java.io.Serializable;

import org.activequant.core.domainmodel.InstrumentSpecification;

/**
 * 
 * Option container. Holds the following associated variables:
 * <ul>
 * <li>delta(double)</li>
 * <li>gamma(double)</li>
 * <li>vega(double)</li>
 * <li>theta(double)</li>
 * <li>rho(double)</li>
 * <li>omega(double)</li>
 * <li>optionInstrument(InstrumentSpecification)</li>
 * </ul>
 * <br>
 * <b>History:</b><br>
 *  - [20.01.2008] Created (Ulrich Staudinger)<br>
 *
 *  @author Ulrich Staudinger
 */
public class Option implements Serializable {
	private static final long serialVersionUID = 228095433305283454L;
	/**
	 * private double delta, gamma, vega, theta, rho, omega; 
	 */
	private double delta, gamma, vega, theta, rho, omega; 
	/**
	 * private InstrumentSpecification optionInstrument;
	 */
	private InstrumentSpecification optionInstrument;
	/**
	 * returns the associated delta(double)
	 * @return
	 */
	public double getDelta() {
		return delta;
	}
	/**
	 * sets the associated delta(double) with the given delta(double)
	 * @param delta
	 */
	public void setDelta(double delta) {
		this.delta = delta;
	}
	/**
	 * returns the associated gamma(double)
	 * @return
	 */
	public double getGamma() {
		return gamma;
	}
	/**
	 * sets the associated gamma(double) with the given gamma(double)
	 * @param gamma
	 */
	public void setGamma(double gamma) {
		this.gamma = gamma;
	}
	/**
	 * returns the associated vega(double)
	 * @return
	 */
	public double getVega() {
		return vega;
	}
	/**
	 * sets the associated vega(double) with the given vega(double)
	 * @param vega
	 */
	public void setVega(double vega) {
		this.vega = vega;
	}
	/**
	 * returns the associated theta(double)
	 * @return
	 */
	public double getTheta() {
		return theta;
	}
	/**
	 * sets the associated theta(double) with the given theta(double)
	 * @param theta
	 */
	public void setTheta(double theta) {
		this.theta = theta;
	}
	/**
	 * returns the associated rho(double)
	 * @return
	 */
	public double getRho() {
		return rho;
	}
	/**
	 * sets the associated rho(double) with the given rho(double)
	 * @param rho
	 */
	public void setRho(double rho) {
		this.rho = rho;
	}
	/**
	 * returns the associated omega(double)
	 * @return
	 */
	public double getOmega() {
		return omega;
	}
	/**
	 * sets the associated omega(double) with the given omega(double)
	 * @param omega
	 */
	public void setOmega(double omega) {
		this.omega = omega;
	}
	/**
	 * returns the associated optionInstrument(InstrumentSpecification)
	 * @return
	 */
	public InstrumentSpecification getOptionInstrument() {
		return optionInstrument;
	}
	/**
	 * sets the associated optionInstrument(InstrumentSpecification) with the given optionInstrument(InstrumentSpecification)
	 * @param optionInstrument
	 */
	public void setOptionInstrument(InstrumentSpecification optionInstrument) {
		this.optionInstrument = optionInstrument;
	} 
	
	/**
	 * updates the delta value of this option. 
	 * The change values must be of the same timeframe, i.e. movement of underlying 
	 * in the last minute and the movement of the option price in the last minute. <br/>
	 * sets the associated delta(double) with: changeOptionPrice(double)/changeUnderlying(double)
	 * @param changeUnderlying i.e. 10.0 
	 * @param changeOptionPrice i.e. 2.0. 
	 */
	public void updateDelta(double changeUnderlying, double changeOptionPrice){
		this.delta = changeOptionPrice / changeUnderlying; 
	}
}
